package com.gwnet.cabinet.enums;

/**
 * 是否
 * @author: WangLiang
 * @date: 2024/7/23 15:31
 */
public enum YesOrNoEnum {
    NO(0,"否"),

    YES(1,"是");

    private Integer code;
    private String desc;

    YesOrNoEnum(Integer code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public Integer code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    public static YesOrNoEnum instance(Integer value) {
        YesOrNoEnum[] enums = values();
        for (YesOrNoEnum statusEnum : enums) {
            if (statusEnum.code().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}
